package com.item.controller;

import com.item.pojo.MenuItem;
import com.item.pojo.Result;
import com.item.service.foodservice;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/food")
@AllArgsConstructor
public class foodcontroller {
    private foodservice foodservice;
    @PostMapping("/getfood")
    public Result getfood(String type){

       List<MenuItem> menuItems =foodservice.getfood(type);
if(menuItems!=null){
    return Result.success(menuItems );

}
        return Result.error("查询失败");
    }
}
